
package cn.edu.scau.cmi.hombio.web.rest;

import org.junit.Test;

import org.junit.runner.RunWith;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.beans.factory.support.DefaultListableBeanFactory;

import org.springframework.context.ApplicationContext;

import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpServletResponse;

import org.springframework.test.context.ContextConfiguration;

import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.RequestScope;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.springframework.web.context.request.SessionScope;

/**
 * Unit test for the <code>PigstyRestController</code> controller.
 *
 * @see cn.edu.scau.cmi.hombio.web.rest.PigstyRestController
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = {
		"file:./resources/pigRs-security-context.xml",
		"file:./resources/pigRs-service-context.xml",
		"file:./resources/pigRs-dao-context.xml",
		"file:./resources/pigRs-web-context.xml" })
public class PigstyRestControllerTest {
	/**
	 * The Spring application context.
	 *
	 */
	private ApplicationContext context;

	/**
	 * Test <code>Pigstypigsty_idpigHouse()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPigstypigsty_idpigHouse() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/pigHouse");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idpigHouse()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PostPigstypigsty_idpigHouse() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/pigHouse");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idpigHouse()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PutPigstypigsty_idpigHouse() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/pigHouse");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idpigHousepighouse_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void DeletePigstypigsty_idpigHousepighouse_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/pigHouse/{pighouse_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idpigHousepighouse_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPigstypigsty_idpigHousepighouse_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/pigHouse/{pighouse_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idfeeds()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPigstypigsty_idfeeds() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/feeds");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idfeeds()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PostPigstypigsty_idfeeds() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/feeds");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idfeeds()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PutPigstypigsty_idfeeds() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/feeds");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idfeedsfeed_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void DeletePigstypigsty_idfeedsfeed_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/feeds/{feed_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idfeedsfeed_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPigstypigsty_idfeedsfeed_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/feeds/{feed_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idtransfers()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPigstypigsty_idtransfers() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/transfers");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idtransfers()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PostPigstypigsty_idtransfers() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/transfers");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idtransfers()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PutPigstypigsty_idtransfers() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/transfers");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idtransferstransfer_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void DeletePigstypigsty_idtransferstransfer_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/transfers/{transfer_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idtransferstransfer_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPigstypigsty_idtransferstransfer_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/transfers/{transfer_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idpreventions()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPigstypigsty_idpreventions() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/preventions");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idpreventions()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PostPigstypigsty_idpreventions() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/preventions");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idpreventions()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PutPigstypigsty_idpreventions() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/preventions");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idpreventionsprevention_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void DeletePigstypigsty_idpreventionsprevention_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/preventions/{prevention_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idpreventionsprevention_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPigstypigsty_idpreventionsprevention_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/preventions/{prevention_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idinspectionExceptions()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPigstypigsty_idinspectionExceptions() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/inspectionExceptions");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idinspectionExceptions()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PostPigstypigsty_idinspectionExceptions() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/inspectionExceptions");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idinspectionExceptions()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PutPigstypigsty_idinspectionExceptions() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/inspectionExceptions");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idinspectionExceptionsinspectionexception_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void DeletePigstypigsty_idinspectionExceptionsinspectionexception_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/inspectionExceptions/{inspectionexception_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idinspectionExceptionsinspectionexception_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPigstypigsty_idinspectionExceptionsinspectionexception_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/inspectionExceptions/{inspectionexception_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idtaskPigsties()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPigstypigsty_idtaskPigsties() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/taskPigsties");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idtaskPigsties()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PostPigstypigsty_idtaskPigsties() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/taskPigsties");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idtaskPigsties()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PutPigstypigsty_idtaskPigsties() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/taskPigsties");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idtaskPigstiestaskpigsty_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void DeletePigstypigsty_idtaskPigstiestaskpigsty_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/taskPigsties/{taskpigsty_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_idtaskPigstiestaskpigsty_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPigstypigsty_idtaskPigstiestaskpigsty_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}/taskPigsties/{taskpigsty_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigsty()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPigsty() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void GetPigstypigsty_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigsty()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PutPigsty() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigsty()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void PostPigsty() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Test <code>Pigstypigsty_id()</code>.
	 */
	@Test
	@SuppressWarnings("unused")
	public void DeletePigstypigsty_id() throws Exception {
		MockHttpServletRequest request = getMockHttpServletRequest();
		request.setRequestURI("/Pigsty/{pigsty_id}");
		MockHttpServletResponse response = getMockHttpServletResponse();

		// Get the singleton controller instance
		PigstyRestController controller = (PigstyRestController) context.getBean("PigstyRestController");

		// TODO Invoke method and Assert return values

	}

	/**
	 * Autowired to set the Spring application context.
	 *
	 */
	@Autowired
	public void setContext(ApplicationContext context) {
		this.context = context;
		((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope("session", new SessionScope());
		((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope("request", new RequestScope());
	}

	/**
	 * Returns a mock HttpServletRequest object.
	 *
	 */
	private MockHttpServletRequest getMockHttpServletRequest() {
		MockHttpServletRequest request = new MockHttpServletRequest();
		ServletRequestAttributes attributes = new ServletRequestAttributes(request);
		RequestContextHolder.setRequestAttributes(attributes);
		return request;
	}

	/**
	 * Returns a mock HttpServletResponse object.
	 *
	 */
	private MockHttpServletResponse getMockHttpServletResponse() {
		return new MockHttpServletResponse();
	}
}